package com.srwl.mytx.converter;

import android.util.Log;

import com.alibaba.fastjson.JSONObject;

import okhttp3.MediaType;
import okhttp3.RequestBody;
import retrofit2.Converter;

final class MyRequestBodyNotEncodeConverter<T> implements Converter<T, RequestBody> {
    private String TAG = "MyRequestBodyNotEncodeConverter";
    private static final MediaType MEDIA_TYPE = MediaType.parse("application/json; charset=UTF-8");


    public MyRequestBodyNotEncodeConverter() {

    }

    @Override
    public RequestBody convert(T value) {
        Log.d(TAG, "该请求不需要处理body");
        byte[] content = JSONObject.toJSONString(value).getBytes();

        return RequestBody.create(MEDIA_TYPE, content);
    }
}
